package servlet;


import service.ICommonService;
import service.impl.CommonServiceImpl;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/home")
public class HomeServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //左边是接口，右边是实现
        ICommonService iCommonService =new CommonServiceImpl();
        req.setAttribute("companyModel", iCommonService.getCommonModelDto());
//       req.setAttribute("companyModel", new CompanyModelIo().getCompanyModel());
        //导航
//        req.setAttribute("navList", new NavModelIo().getNavListFromNote());//这是导航数据

        //动态
//        req.setAttribute("homeModel", new HomeIo().getFromHomeModelIo());
        //底部

        req.getRequestDispatcher("/jsp/home.jsp").forward(req,resp);//转发到页面
    }
}
